package com.schrodinger.zwebservice.axis2.client.util;

public class WSClientUtils {
	
	/**
	 * 根据包的全路径产生对应的WebService的namespace
	 * @param classNameWithPackage
	 * @return
	 */
	public static String getQNameSpace(String classNameWithPackage){
		if(classNameWithPackage == null){
			return "";
		}
		String[] strs = classNameWithPackage.split("\\.");
		StringBuilder sb = new StringBuilder(classNameWithPackage.length());
		sb.append("http://");
		for(int i = strs.length-2 ; i > -1 ; i--){
			sb.append(strs[i]);
			if(i != 0){
				sb.append(".");
			}
		}
		return sb.toString();
	}
	
	public static void main(String[] args) {
		System.out.println(getQNameSpace("User"));
	}
}
